package cn.hiapi.shopkeeper.jpa.order;

import cn.hiapi.basic.jpa.BasicRepository;
import cn.hiapi.shopkeeper.entity.order.ActivityVoteOrder;
import com.alibaba.fastjson.JSONObject;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author AdinZ
 * @date 2023/2/3 22:52
 */
public interface ActivityVoteOrderJpa extends BasicRepository<ActivityVoteOrder,Long> {
    @Query("select e.aid as aid,e.otherId as otherId,count(e.id) as count from ActivityVoteOrder e where e.aid=?1  group by e.otherId ")
    List<JSONObject> activityRank(long aid);
}
